<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Model;

class Linkslistsimages extends Model
{
    protected $table = 'links_lists_images';
    protected $primaryKey = 'id';

    public static function linksListsImagesUpdate($users_id,$img,$check)
    {
        return self::where("id",$id)->update(["title"=>$title,"img"=>$img,"type"=>$type,"disable"=>$disable,"msg"=>$msg]);
    }

    public static function linksListsImagesInsert($users_id,$img,$check,$remark)
    {
        return self::insert(["users_id"=>$users_id,"img"=>$img,"check"=>$check,"remark"=>$remark,"created_at"=>time()]);
    }

    public static function getLinksListsImages($users_id)
    {
        $query = self::query();
        if (!empty($users_id)) $query->where('users_id', $users_id);
        return $query->orderBy("id","DESC")->paginate(10);
    }
}
